package gateway

import (
	"fmt"
	"net/http"
	"strings"
	"sync"
)

const mascotHeaderKeyFormat = "X-Mascot-%03d"

var oneMascot sync.Once

func addMascotHeaders(w http.ResponseWriter) {
	oneMascot.Do(func() {
		xMascot := strings.Split(mascot, "\n")

		for i := 0; i < len(xMascot); i++ {
			key := fmt.Sprintf(mascotHeaderKeyFormat, i)
			w.Header().Set(key, xMascot[i])
		}
	})
}

const mascot = `
.                   ╲╲╲╲╲╲
.                   ╲╲╲╲╲╲╲╲╲
.            *******╲╲╲╲╲╲╲╲╲╲╲
.           **********╲╲╲╲╲╲╲╲╲╲
.        ***************╲╲╲╲╲╲╲╲╲╲
.      ******************╲╲╲╲╲╲╲╲╲
.     ********************╲╲╲╲╲╲╲╲╲
.    ***********************╲╲╲╲╲╲╲╲
.   *************************** ╲╲╲╲╲╲
.   ****************************    ╲╲╲
.   *****      *******      ****     _______      _        _
.   ******      *****      *****    |__   __|    | |      (_)
.   ****************************       | | _   _ | | __    _   ___
.   *****************************      | || | | || |/ /   | | / _ \
.   ******************************     | || |_| ||   <  _ | || (_) |
.  ********************************    |_| \__, ||_|\_\(_)|_| \___/
. *********************************         __/ |
. ***  ************* *********  ****       |___/
.       *********************
.         *****************
.          ******* ******
.            ***** *****
.           ****** ******
`
